2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "../jucer_Headers.h"
27 #include "jucer_ComponentLayoutPanel.h"
30 //==============================================================================
31 class LayoutPropsPanel
: public Component
,
35 //==============================================================================
36 LayoutPropsPanel (JucerDocument
& document_
, ComponentLayout
& layout_
)
37 : document (document_
),
40 layout
.getSelectedSet().addChangeListener (this);
42 addAndMakeVisible (propsPanel
= new PropertyPanel());
47 layout
.getSelectedSet().removeChangeListener (this);
53 //==============================================================================
56 propsPanel
->setBounds (4, 4, getWidth() - 8, getHeight() - 8);
59 void changeListenerCallback (ChangeBroadcaster
*)
73 if (layout
.getSelectedSet().getNumSelected() == 1) // xxx need to cope with multiple
75 Component
* comp
= layout
.getSelectedSet().getSelectedItem (0);
79 ComponentTypeHandler
* const type
= ComponentTypeHandler::getHandlerFor (*comp
);
82 type
->addPropertiesToPropertyPanel (comp
, document
, *propsPanel
);
88 JucerDocument
& document
;
89 ComponentLayout
& layout
;
91 PropertyPanel
* propsPanel
;
96 //==============================================================================
97 ComponentLayoutPanel::ComponentLayoutPanel (JucerDocument
& document_
, ComponentLayout
& layout_
)
98 : EditingPanelBase (document_
,
99 new LayoutPropsPanel (document_
, layout_
),
100 new ComponentLayoutEditor (document_
, layout_
)),
105 ComponentLayoutPanel::~ComponentLayoutPanel()
110 void ComponentLayoutPanel::updatePropertiesList()
112 ((LayoutPropsPanel
*) propsPanel
)->updateList();
115 const Rectangle
<int> ComponentLayoutPanel::getComponentArea() const
117 return ((ComponentLayoutEditor
*) editor
)->getComponentArea();
120 const Image
ComponentLayoutPanel::createComponentSnapshot() const
122 return ((ComponentLayoutEditor
*) editor
)->createComponentLayerSnapshot();